<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>ECMAsctipt入门介绍</title>
</head>
<body>
    <!-- 1.理解：
        * 从对象或数组中提取数据，并赋值给变量（多个）
    2.对象的结构赋值
        let {n,a} = {n:'tom',a:12}
    3. 数组的结构赋值
        let [a,b] = [1,'adada']
    4. 用途
        * 给多个形参赋值 -->
    <script>
        let obj = {
            username:'kobe',
            age:39
        }
        let {username,age} = obj //必须是人家已有的属性
        console.log(username,age) 

        let arr = [1,2,4,'abc',true]
        // let [a,b,c,d,e] = arr
        // console.log(a,b,c,d,e)
        let [,,,a,b] = arr
         console.log(a,b)
    </script>
</body>
</html>